<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>minus</title>
<style type="text/css">
	body {background-color: white; color: black; font-family:sans-serif; font-size:medium;}
	a:link {color: #3300ff;}
	a:visited {color: #663399;}
	a:hover {color:#0099ff;}
	a:active {color: #0066cc;}
	a.button {text-decoration:none;}
	
	table.nav  {background-color: #dbddff;}
	table.body {margin-top:2ex; margin-bottom:2ex;}
	table.programlistingindent {margin-left:32px;}
	
	img { margin-bottom:0px; margin-top:0px;}
	tt {margin-left:0.5em; margin-right:0.5em; font-weight:lighter;}
	
	p {margin-top:0ex;}
	p.synopsis {margin-left:32px;}
	p.programlistingindent {margin-left:32px;}
	p.citetitle {margin-left:2em;}
	
	ul ul {list-style-type:square;}
	ul li p {margin-top:0ex; margin-bottom:.5ex; padding:0}
	ol li p {margin-top:0ex; margin-bottom:.5ex; padding:0}
	
	h1.reftitle {color:#a90000;}
	h1.reftitle {font-size:3.7ex; margin-top:0; margin-bottom:0; font-weight:bold}
	h1.title {color:black; font-size:4ex; margin-top:1ex; font-weight:bold}
	h2.title {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:3ex}
	h3.title {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:2.5ex}
	h4.title {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:2ex}
	h2 {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:2.5ex}
	h3 {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:2ex} 
	
	pre.programlisting {margin-left:32px;}
	pre.synopsis {margin-left:32px;}
	
	
	.categorytitle {margin-top:8px; padding-top:0px;}
	.categorylist {background-color: #e1e6f2;}
 	</style>
</head>
<body>
<a name="top_of_page"></a><p style="font-size:1px;"></p>
<h1 class="reftitle">minus</h1>
<h2>Purpose</h2>
<p>Pontryagin/Minkowski difference for union of polyhedra</p>
<h2>Syntax</h2>
<pre class="synopsis">U - W</pre>
<pre class="synopsis">U.minus(W)</pre>
<h2>Description</h2>
<p></p>
            Computation of Pontryagin or Minkowski difference for the union of polyhedra in the same dimension.
            The algorithm for efficiently computing the Minkowski difference between a union of polytopes
            and a polytope is based on a talk by S. Rakovic and D. Mayne entitled <em>Constrained Control Computations</em>
            It was the keynote addressed at the GBT Meeting, London, November, 2002.

            The algorithm proceeds in the following way:
            <ol>
                
         <li>Compute the convex hull of the union. </li>
                
         <li>Compute the Minkowski difference of each of the polyhedron from the convex hull. </li> 
                
         <li>Compute the set difference between the convex hull and the union. </li>
                
         <li>Compute the set difference between the Minkowski difference for each polyhedron and the set obtained in the previous step.</li>
            
      </ol>
            The result is a non-overlapping union of the polyhedra.
    <h2>Input Arguments</h2>
<table cellspacing="0" class="body" cellpadding="4" border="0" width="100%">
<colgroup>
<col width="31%">
<col width="69%">
</colgroup>
<tbody>
<tr valign="top">
<td><tt>U</tt></td>
<td>
<p></p>Union of polyhedra in the same dimension.<p>
	    		Class: <tt>PolyUnion</tt></p>
</td>
</tr>
<tr valign="top">
<td><tt>W</tt></td>
<td>
<p></p>Polyhedron to be summed with the union that is in the same dimension as the union.<p>
	    		Class: <tt>Polyhedron</tt></p>
</td>
</tr>
</tbody>
</table>
<h2>Example(s)</h2>
<h3>Example 
				1</h3> Create three polyhedra that form bounded union. <pre class="programlisting"> P(1) = Polyhedron('V',[-5 0;-4 0;-5 5;-4 5]); </pre>
<pre class="programlisting"></pre>
<pre class="programlisting"> P(2) = Polyhedron('V',[-4 1;-1 1.5;-4 4;-1 2.5]); </pre>
<pre class="programlisting"></pre>
<pre class="programlisting"> P(3) = Polyhedron('V',[-1 0; -1 4]); </pre>
<pre class="programlisting"></pre>
<pre class="programlisting"> U = PolyUnion('Set',P,'bounded',true) </pre>
<pre class="programlisting">PolyUnion in the dimension 2 with 3 polyhedra.
Properties of the union: 
  Bounded: 1
Functions : none
</pre> Compute Minkowski difference for full-dimensional and bounded polyhedron <img src="../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/minus1.png" alt="../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/minus1.png">.<pre class="programlisting"> W = Polyhedron('lb',[-0.1, -0.2],'ub',[0.1, 0.2]); </pre>
<pre class="programlisting"></pre>
<pre class="programlisting"> Uw = U - W </pre>
<pre class="programlisting">PolyUnion in the dimension 2 with 5 polyhedra.
Properties of the union: 
  Overlaps: 0
  Bounded: 1
Functions : none
</pre> Plot the new union <tt>Uw</tt> 
      <pre class="programlisting"> U.plot('color','lightblue'), hold on, Uw.plot </pre>
<pre class="programlisting"></pre>
<p class="programlistingindent"><img src="../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/minus_img_1.png" alt="../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/minus_img_1.png" width="60%"></p> Compute Minkowski addition for low-dimensional and bounded polyhedron <img src="../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/minus2.png" alt="../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/minus2.png">.<pre class="programlisting"> S = Polyhedron('lb',[-0.1, 0],'ub',[0.1, 0]); </pre>
<pre class="programlisting"></pre>
<pre class="programlisting"> Us = U - S </pre>
<pre class="programlisting">PolyUnion in the dimension 2 with 5 polyhedra.
Properties of the union: 
  Overlaps: 0
  Bounded: 1
  FullDim: 1
Functions : none
</pre> Plot the new union <tt>Us</tt> 
      <pre class="programlisting"> U.plot('color','lightgreen'), hold on, Us.plot </pre>
<pre class="programlisting"></pre>
<p class="programlistingindent"><img src="../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/minus_img_2.png" alt="../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/minus_img_2.png" width="60%"></p>
<h2>See Also</h2>
<a href="./convexhull.html">convexhull</a>, <a href="../../sets/@Polyhedron/plus.html">plus</a><p></p>
<table class="nav" summary="Navigation aid" border="0" width="100%" cellpadding="0" cellspacing="0"><tr valign="top">
<td align="left" width="20">
<a href="ge.html" class="button">&#9664;</a>  </td>
<td align="left">ge</td>
<td>  </td>
<td align="right">contains</td>
<td align="right" width="20"><a href="contains.html" class="button">&#9654;</a></td>
</tr></table>
<br><p>©  <b>2010-2013</b>     Martin Herceg: ETH Zurich,    <a href="mailto:herceg@control.ee.ethz.ch">herceg@control.ee.ethz.ch</a></p>
<p>©  <b>2005</b>     Mario Vasak:  FER Zagreb ,    <a href="mailto:mario.vasak@fer.hr">mario.vasak@fer.hr</a></p>
<p>©  <b>2003-2013</b>     Michal Kvasnica: STU Bratislava,    <a href="mailto:michal.kvasnica@stuba.sk">michal.kvasnica@stuba.sk</a></p>
<p>©  <b>2003-2005</b>     Pascal Grieder:  ETH Zurich ,    <a href="mailto:grieder@control.ee.ethz.ch">grieder@control.ee.ethz.ch</a></p>
<p>©  <b>2003</b>     Mato Baotic:  ETH Zurich ,    <a href="mailto:baotic@control.ee.ethz.ch">baotic@control.ee.ethz.ch</a></p>
</body>
</html>
